home *** CD-ROM | disk | FTP | other *** search
- Path: cymbal.aix.calpoly.edu!not-for-mail
- From: dstubbs@cymbal.aix.calpoly.edu (Dan Stubbs)
- Newsgroups: comp.lang.c
- Subject: Re: Limit on #bytes inside of struct?
- Date: 14 Feb 1996 17:28:28 -0800
- Organization: California Polytechnic State University, San Luis Obispo
- Message-ID: <4fu27s$2i23@cymbal.aix.calpoly.edu>
- References: <4feg1d$d4g@cville-srv.wam.umd.edu> <4ffohq$1gb@mordred.gatech.edu> <4ffun7$1l4l@cymbal.aix.calpoly.edu> <311F15D8.78D1@zess.uni-siegen.de>
- NNTP-Posting-User: dstubbs@cymbal.aix.calpoly.edu
-
- In article <311F15D8.78D1@zess.uni-siegen.de>,
- Markus Becker <becker@zess.uni-siegen.de> wrote:
- >Dan Stubbs wrote:
- >> Here is a specific program to test the above suggestions.
- >
- >No it isn't, see below.
- >
- >> typedef struct {
- >> int the_array[50000];
- >> } struct_type;
- >>
- >
- >This way, you don't put the 50K numbers in the struct, but only
- >a pointer to them. Should be at most 4 bytes.
- >
- >--
- >Markus Becker
-
- I wonder if you tried this? I applied the sizeof operator to both
- the type and to instances of the type and got 200000 for the size.
- This was for a half dozen different compiler/hardware pairs.
-
- So, if you know of a system that actually stores a pointer to the
- array as the struct, instead of the array, it would be interesting
- to know which it is.
-
- To be honest, I don't see any advantage to storing the pointer instead
- of the array. Every instance of struct_type will have to have its own
- array to which it points. Why complicate things by setting the array
- somewhere else and accessing it indirectly (all behind the scenes).
-
- It would be different if all instances of struct_type could share
- one array--but alas they can't.
-
-
-
-